﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

using Weazel.Math;

using Microsoft.VisualStudio.TestTools.UnitTesting;

#endregion

namespace Weazel.Math.Test
{
  [TestClass]
  public class TestSimpleSubtraction
  {
    [TestMethod]
    public void TestSingleFigureSubtraction_1()
    {
      Integer a = new Integer(8, 1, false);
      Integer r = new Integer(8, false);

      Integer.Subtract(ref r, a, 1);

      Assert.AreEqual(0, r.ToInt());
    }

    [TestMethod]
    public void TestSingleFigureSubtraction_2()
    {
      Integer a = new Integer(32, 0, true);
      Integer r = new Integer(64, true);

      Integer.Subtract(ref r, a, 1);

      Assert.AreEqual("ffffffffffffffff", r.ToHexadecimalString());
    }

    [TestMethod]
    public void TestSingleFigureSubtraction_3()
    {
      Integer a = new Integer(64, 10, true);
      Integer r = new Integer(96, true);

      Integer.Subtract(ref r, a, 11);

      Assert.AreEqual(96, r.Width);
      Assert.AreEqual("ffffffffffffffffffffffff", r.ToHexadecimalString());
    }
  }
}
